Claude/hermes mcp servers c dr8 b#2
Merged
Conversation
Always-on utility tools registered at startup — no YAML config needed.
Gives LLMs read-only access to a configurable files directory (default:
.playwright-mcp) so they can retrieve screenshots and snapshots produced
by package providers such as the Playwright MCP server.
New files
builtin_tools.py — list_files + get_file handlers; _safe_resolve
prevents path-traversal (../); encoding=auto/text/base64
Changes
config.py — FILES_DIR constant (MCPPROXY_FILES_DIR env var)
server.py — register_builtin_tools() called at startup before
YAML providers; exported for tests
Dockerfile — COPY builtin_tools.py
README.md — layout, intro, Part 9 tutorial, parameter tables
Tests (31 new, 175 total)
tests/test_builtin_tools.py — 26 tests: empty dir, file listing,
sorted entries, subdirectory drill-down, path-traversal rejection,
text/base64/auto encoding, PNG roundtrip, size reporting
tests/test_server.py — 5 tests: register_builtin_tools exports,
mcp.tool called twice, tool names, getfile requires path
https://claude.ai/code/session_016EMphWWMguzwVrfAYvJFSX
After the initial tool call + Ollama summary, the script now:
Step 10 — calls mcpproxy-listfiles (root of files dir, default
.playwright-mcp) and mcpproxy-getfile for every file found.
A single Python block handles both MCP calls with proper SSE
unwrapping and session-ID headers; arbitrary file names are
safe because Python manages the HTTP calls directly.
Step 11 — asks Ollama to summarise what was produced:
- text files (JSON snapshots, HTML, logs): contents included,
truncated at 4000 chars each
- binary files (PNG screenshots etc.): name + size noted,
base64 payload omitted from prompt
- errors: surfaced inline
- relates file contents back to the original tool call
If no files are found the extra steps are skipped cleanly.
https://claude.ai/code/session_016EMphWWMguzwVrfAYvJFSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.